// 方块行数
const BOARD_ROW = 9;
// 方块列数
const BOARD_COL = 6;
// 方块种类
const BLOCK_TYPE = 6;
// 方块宽度、高度
const BLOCK_WIDTH = 70;
const BLOCK_HEIGHT = 70;

function genRandomInt(min, max) {
    return Math.floor(Math.random() * (max-min)) + min;
}

// 方块状态
const iconState = cc.Enum({
    normal: -1,
    move: -1,
    preCancel: -1,
    preCancel2: -1,
    cancel: -1,
    canceled: -1,
});
// 移动方向
const direct = cc.Enum({
    left: 'left',
    up: 'up',
    right: 'right',
    down: 'down',
});

const boardState = cc.Enum({
    // 等待操作
    ready: 'ready',
    moving: 'moving',
    // 交换
    exchange: 'exchange',
    // // 取消
    // cancel: 'cancel',
});

// 方块图标
const iconItemType = cc.Enum({
    red: 1,
    orange: 2,
    purple: 3,
    blue: 4,
    green: 5,
    yellow: 6,
});

module.exports = {
    BOARD_ROW,
    BOARD_COL,
    BLOCK_TYPE,
    iconState,
    direct,
    boardState,
    genRandomInt,
    iconItemType,
    BLOCK_WIDTH,
    BLOCK_HEIGHT,
};